<nav id="menu_right">
    <ul>
        <li><a href="/faction/privacy/<%=faction.id %>"><span class="icon-lock"></span> 隐私设置 <!--<span class="badge">12</span>--></a></li>
        <!--<li><a href="/faction/log/<%=faction.id %>"><span class="icon-newspaper"></span> 圈子动态 &lt;!&ndash;<span class="badge">42</span>&ndash;&gt;</a></li>-->
        <% if(faction.creator._id == currentUser.id){ %>
        <li><a href="javascript:deleteFaction('<%=faction.id %>');"><span class="icon-cross"></span> 注销圈子 <!--<span class="badge">42</span>--></a></li>
        <li><a href="/updatefaction/<%=faction.id %>"><span class="icon-cog"></span> 圈子信息</a></li></li>
        <li><a href="/goodslist/<%=faction.id %>"><span class="icon-house"></span> 礼品商城</a></li></li>
        <li><a href="/orderlist/<%=faction.id %>/waiting"><span class="icon-listi"></span> 订单列表</a></li></li>
        <% } %>
    </ul>
</nav>
<script>
    function deleteFaction(id){
        AlertBox.showConfirm('确定要注销这个圈子?',
                {ok:'是的',cancel:'取消'},
                function(){
                    $.post('/faction_del', {id: id}, function(res){
                        console.log(res)
                        if(res.error){
                            return AlertBox.showTip('删除出错...');
                        }
                        window.location.href = '/myfactions'
                    })
                    AlertBox.closeAlertBox();
                }, function(){
                    AlertBox.closeAlertBox();
                });
    }
</script>